package com.zrwl.poscloud.base.enums;

/**
 * 导入状态枚举类
 */
public enum ImportStatus {

    //在系统字典里为dss_status

    //客户端状态
    waitGenerated(1, "客户端文件待生成"),
    generating(2,  "客户端文件生成中"),
    generateFailed(3, "客户端文件生成失败"),
    waitUploaded(4,  "客户端文件生成完毕等待上传"),
    uploadFailed(5,  "客户端文件上传失败"),
    uploadCanceled(6, "客户端取消取消文件上传"),
    waitServerHandle(7,  "客户端文件上传成功等待服务器处理"),

    //服务器端状态
    serverHandling(11,  "服务器正在处理文件"),
    importSuccess(12,  "服务器导入成功"),
    timeOut(13, "服务器导入超时"),
    importFailed(14, "服务器导入失败"),

    //服务器进度

    //云端向本地服务器发起申请更新数据库
    createRecoverFileIng(21,"正在生成文件"),
    createRecoverFileSuccess(22,"文件生成完毕"),
    createRecoverFileFailed(23,"文件生成失败");



    private final int importStatus;
    private final String name;

    ImportStatus(int importStatus, String name) {
        this.importStatus = importStatus;
        this.name = name;
    }

    public int getImportStatus() {
        return importStatus;
    }

    public String getName() {
        return name;
    }

    public static ImportStatus getEumByCode(int Code) {
        for (ImportStatus testEnums : ImportStatus.values()) {
            if (testEnums.getImportStatus() == Code) {
                return testEnums;
            }
        }
        return null;
    }



}


